//
//  ZXNewsImageTableViewCell.swift
//  ZNZXSuperMarket
//
//  Created by 四川中农 on 2018/9/7.
//  Copyright © 2018年 四川中农. All rights reserved.
//

import UIKit

class ZXNewsImageTableViewCell: UITableViewCell {

    @IBOutlet weak var imageV: UIImageView!
    @IBOutlet weak var newsTitle: UILabel!
    @IBOutlet weak var tagLabel: UILabel!
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
        self.imageV.setCornerRadio(radio: 10, isMask: true)
        self.tagLabel.setCornerRadio(radio: 10, isMask: true)
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
    func reload(withModel model:NewsModel){
        self.imageV.my_setImage(url: model.img, placeholder: Api.placeHolder.rawValue)
        self.newsTitle.text = model.title
        if model.type == 0 {
            self.tagLabel.text = "咨询"
            self.tagLabel.backgroundColor = UIColor.init(hexColor: "#f7c201")
        }else{
            self.tagLabel.text = "帮助"
            self.tagLabel.backgroundColor = UIColor.init(hexColor: "##12da6b")
        }
    }

}
